<template>
	<view>
		<view class="formBox" v-for="item in formList" @click="toFormList(item)">
			<view class="formName">
				{{ item.formName }}
			</view>
			<view class="formDescribe" v-if="item.formDescribe">
				{{ item.formDescribe }}
			</view>
		</view>
		<view class="" style="margin-top: 200rpx;" v-if="formList.length==0">
			<u-empty mode="data"></u-empty>
		</view>
	</view>
</template>

<script>
	import { searchAdminUserById, searchPlugsFormList } from '@/utils/api.js';
	export default {
		data() {
			return {
				plugsId:'',
				formList:[]
			};
		},
		onLoad (option) {
			uni.setNavigationBarTitle({
				title: option.title
			})
			this.plugsId=option.plugsId
		},
		onShow () {
			this.getFormList()
		},
		methods:{
			getFormList(){
				let data={
					page: 1,
					size: 50,
					adminId:  uni.getStorageSync('userInfo').id,
					userServiceToken:  uni.getStorageSync('userInfo').userServiceToken,
					plugsId: this.plugsId,
				}
				searchPlugsFormList(data).then((res=>{
					if(res.code==200){
						this.formList=res.body.list
					}
				}))
			},
			toFormList(item){
				uni.navigateTo({
					url:'/subpack_plugin/submitForm/formList?formId='+item.id
				})
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color: #f5f5f5;
		padding: 20rpx 30rpx;
		box-sizing: border-box;
	}
	.formBox{
		background-color: #fff;
		padding: 20rpx;
		border-radius: 15rpx;
		margin-bottom: 15rpx;
		.formName{
			font-size: 32rpx;
			
			font-weight: 700;
		}
		.formDescribe{
			font-size: 28rpx;
			color: #666;
			margin-top: 15rpx;
		}
	}
	
</style>
